var my = {};

my.init =function(){	
	var options = {
		id:Feng.userId
	}	
	var ajax = new $ax(Feng.ctxPath+"/user/getById", function(data){        
        if (data.success){
        	var imgSrc = data.obj.headImgUrl || "themes/img/user/head-3.jpg"
        	$("#photo").attr("src",data.obj.headImgUrl);
        	$("#name").text(data.obj.name);
        }
        else if(data.code === 2){
        	Feng.open(data.msg);
        }
        else{
        	Feng.log("获取用户信息失败");
        }        
   },function(data){    	
        Feng.log("获取用户信息失败");
    });
    ajax.set(options);
    ajax.start();	
};



$(function(){
	my.init();
	//绑定滚动条事件
	$(window).bind("scroll", function () {
	    var sTop = $(window).scrollTop();
	    var sTop = parseInt(sTop);
	    if (sTop >= 44) {
	        if (!$("#scrollSearchDiv").is(":visible")) {
	            try {
	                $("#scrollSearchDiv").slideDown();
	            } catch (e) {
	                $("#scrollSearchDiv").show();
	            }
	        }
	    }
	    else {
	        if ($("#scrollSearchDiv").is(":visible")) {
	            try {
	                $("#scrollSearchDiv").slideUp();
	            } catch (e) {
	                $("#scrollSearchDiv").hide();
	            }
	        }
	    }
	});
})
